window.onload = function () {
  const clock = document.getElementById("clock");
  const fmt = (t) => (t < 10 ? `0${t}` : t);
  function myTime() {
    const time = new Date();
    const { h, m, s } = {
      h: fmt(time.getHours()),
      m: fmt(time.getMinutes()),
      s: fmt(time.getSeconds()),
    };
    clock.innerText = h + ":" + m + ":" + s;
  }
  setInterval(myTime, 1000);
};
